Skip to content

Add dynamic RSI semiconductor indicators#26

Merged
Pigbibi merged 2 commits into
mainfrom
codex/soxl-dynamic-rsi-live
May 7, 2026
Merged

Add dynamic RSI semiconductor indicators#26
Pigbibi merged 2 commits into
mainfrom
codex/soxl-dynamic-rsi-live

Conversation

@Pigbibi

@Pigbibi Pigbibi commented May 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add rsi14_dynamic_threshold to shared SOXL/SOXX semiconductor rotation indicators using max(floor, rolling RSI quantile)
  • increase LongBridge and IBKR SOXL/SOXX history lookbacks so the 252d dynamic RSI threshold has enough data
  • bump package version to 0.7.20 and update platform indicator tests

Long-horizon validation

Using Yahoo adjusted SOXL/SOXX and BIL-as-BOXX data from 2010-10-04 to 2026-05-06, the live dynamic q90/floor70 logic produced:

  • CAGR 46.52%, MaxDD -44.00%, Sharpe 1.07
  • fixed70 comparison: CAGR 45.94%, MaxDD -44.00%, Sharpe 1.06
  • fixed72 comparison: CAGR 46.26%, MaxDD -44.31%, Sharpe 1.06

Validation

  • slowrun bash -lc 'PYTHONPATH=src .venv/bin/python -m pytest tests/test_ibkr_runtime_inputs.py tests/test_longbridge_market_data.py'
  • slowrun bash -lc 'PYTHONPATH=src .venv/bin/python -m pytest tests'
  • git diff --check

Note: local QPK venv does not have ruff installed, so ruff was not run locally.

@Pigbibi

Pigbibi commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c82b31618e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

rsi_threshold_history = (
soxx_rsi_history.rolling(
rsi_quantile_window,
min_periods=max(60, min(rsi_quantile_window, 126) // 2),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Clamp RSI rolling min_periods to window size

When dynamic_rsi_quantile_window is set below 60, this computes min_periods as at least 60, which makes min_periods > window and causes pandas to raise ValueError at runtime (for example, window 20 -> min_periods 60). Since this parameter is now publicly configurable through the IBKR/LongBridge helpers, valid-looking non-default configs can crash indicator generation instead of degrading gracefully.

Useful? React with 👍 / 👎.

Comment thread pyproject.toml
[project]
name = "quant-platform-kit"
version = "0.7.19"
version = "0.7.20"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep runtime version constant aligned with project version

This bumps the package metadata to 0.7.20, but the exported quant_platform_kit.__version__ constant remains 0.7.19 in src/quant_platform_kit/__init__.py. That creates conflicting version sources (metadata vs runtime constant), which can break version-gated behavior, diagnostics, or compatibility checks that read __version__.

Useful? React with 👍 / 👎.

@Pigbibi

Pigbibi commented May 7, 2026

Copy link
Copy Markdown
Contributor Author

Addressed Codex review feedback:

  • clamped dynamic RSI rolling min_periods so it never exceeds the configured quantile window, with a regression test for a 20-day window
  • synced quant_platform_kit.version with pyproject.toml at 0.7.20

Validation after fixes: slowrun PYTHONPATH=src .venv/bin/python -m pytest tests -> 134 passed; CI is green.

@Pigbibi Pigbibi merged commit 3368b26 into main May 7, 2026
1 check passed
@Pigbibi Pigbibi deleted the codex/soxl-dynamic-rsi-live branch May 7, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant